Solution
\(\tan \theta = \dfrac{x_1}{x}\)
\(\tan {\beta} = \dfrac{L}{x} \; \beta = \theta_2 + \theta_1 \; L = x_1 + x_2 \)
\(\dfrac{x_1}{\tan \theta_1} = \dfrac{L}{\tan \beta}\) to have the best view, \(\theta_2\) must be maximized.
\(
\dfrac{L-x_2}{\tan(\beta - \theta_2)} = \tan(L) \cdot \tan(\theta_1 + \theta_2)
\)
\(\theta_1 = \tan^-1 {\dfrac{x_1}{x}}\)
\( \tan{(\theta_1 + \theta_2)} = \dfrac{L}{x}\)
\( \tan{(\tan^-1 {\dfrac{x_1}{x}} + \theta_2)} = \dfrac{L}{x}\)
\( \tan^-1 {(\dfrac{x_1}{x})} + \theta_2 = \tan^-1{(\dfrac{L}{x})}\)
\( \theta_2 = \tan^-1{(\dfrac{L}{x})} - \tan^-1 {\dfrac{x_1}{x}}\)
\(\frac{\theta_2}{dx} = -\frac{\frac{L}{x^2}}{1+ \left(\frac{L}{x}\right)^2} - \frac{\frac{x_1}{x^2}}{1+\left(\frac{x_1}{x}\right)^2}\)
\(0 = -\frac{\frac{L}{x^2}}{1+\left(\frac{L}{x}\right)^2} + \frac{\frac{x_1}{x^2}}{1+\left(\frac{x_1}{x}\right)^2}\)
\(\frac{\frac{L}{x^2}}{1+\left(\frac{L}{x}\right)^2} = \frac{\frac{x_1}{x^2}}{1+\left(\frac{x_1}{x}\right)^2}\)
\( [1+(\dfrac{x_1}{x})^2][L] = (x_1) (1+\frac{L}{x})^2\)
\( 1 + \dfrac{x_1^2}{x^2} = \dfrac{x_1}{L} + \dfrac{x_1L}{x^2}\)
\( 1 + \dfrac{x_1^2}{x^2} - \dfrac{x_1 L}{x^2} = \dfrac{x_1}{L}\)
\( \dfrac{1}{x^2} [x_1^2 - x_1 L] = \dfrac{x_1 - L}{L}\)
\( \dfrac{L}{x_1 - L} [x_1^2 -x_1L] = x^2\)
\( \dfrac{L(x_1)}{x_1 - L} [x_1 -L] = x^2\)
\( L(x_1) = x^2\)
\( x = \sqrt{Lx_1}\)
\( x = \sqrt{L(L-x_2)}\)
\( x = \sqrt{L^2-x_2L}\)